sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb\_release -cs) stable"
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io

# 验证安装是否完成
docker --version
docker version
sudo docker info

# 是否真的需要，下次测试
# sudo groupadd docker          #添加docker用户组
# sudo gpasswd -a wj docker     #将当前用户添加至docker用户组
# newgrp docker                 #更新docker用户组

sudo systemctl start docker

sudo tee /etc/docker/daemon.json <<-'EOF'
{
    "registry-mirrors": [
        "https://hub-mirror.c.163.com",
        "https://mirror.baidubce.com",
        "https://docker.mirrors.ustc.edu.cn"
    ],
    "proxies": {        
        "http-proxy": "socks5://127.0.0.1:7890",        
        "https-proxy": "socks5://127.0.0.1:7890",        
        "no-proxy": "http://example.com"    
    }
}
EOF

sudo systemctl daemon-reload
sudo service docker restart

# 代理配置
# nvim /etc/docker/daemon.json
```json 
    "proxies": {        
        "http-proxy": "socks5://127.0.0.1:7890",        
        "https-proxy": "socks5://127.0.0.1:7890",        
        "no-proxy": "http://example.com"    
    }

```

# 安装
docker pull hello-world
docker pull monius/petalinux

# 查看已安装docker镜像
# docker images

# 测试安装是否成功
# docker run --rm hello-world
#
# https://hub.docker.com/
#
# # 搜索
# docker search centos
#
# 下载
# docker pull centos
#
#
# 删除本地镜像
# docker image rm
#
# 复制主机内容到docker
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
